from pydantic import BaseModel
from typing import List, Optional, Dict, Tuple
from datetime import date
from ..students.schemas import Student

# 2.1 查询所有超过30岁的学员的信息
# 可以直接使用现有的Student模型

# 2.2 统计每个班级男生女生的人数
class GenderCount(BaseModel):
    male: int
    female: int

class ClassGenderStats(BaseModel):
    class_name: str
    gender_count: GenderCount

# 2.3 查询每次考试成绩都在80分以上的学生的编号，姓名和成绩
class HighScoreStudent(BaseModel):
    student_id: str
    student_name: str
    min_score: float

# 2.4 查询有两次以上不及格的学生的姓名，班级和不及格成绩
class FailedExamDetail(BaseModel):
    exam_sequence: int
    score: float

class FrequentFailStudent(BaseModel):
    student_name: str
    class_name: str
    failed_exams: List[FailedExamDetail]

# 2.5 统计每次考试每个班级的平均分，按照从高到低排序
class ClassExamAverageScore(BaseModel):
    class_name: str
    exam_sequence: int
    average_score: float

# 2.6 统计就业薪资最高的前五名学生的姓名，班级和就业时间，就业公司
class TopSalaryStudent(BaseModel):
    student_name: str
    class_name: str
    offer_date: Optional[date] = None
    company_name: Optional[str] = None
    salary: Optional[float] = None